package com.xpxrule.constant;

/**
 * 业务模型字段取值类型枚举
 */
public enum BusinessModelFieldValueType {

    BASIC_TYPE("basicType", "基本类型"),
    ENUM_CONSTANT("enumConstant", "枚举常量"),
    CUSTOM_TYPE("customType", "自定义类型");
    ;
    private String code;
    private String name;

    BusinessModelFieldValueType(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    public static BusinessModelFieldValueType getValueTypeByType(String type) {
        for (BusinessModelFieldValueType valueType : values()) {
            if (valueType.getCode().equals(type)) {
                return valueType;
            }
        }
        return null;
    }
}
